# -*- coding: utf-8 -*-

'''
/**
 * @addtogroup esm_main
 * esm_main
 * @{
 */
/**
 * @file        esm_main.py
 * @brief       XXXX
 * @note        XXXX
 * @author      靳普诏(puzhao.jin@hopechart.com)
 * @date        2023/08/26
 * @version     1.0

 * @par         修改日志
 * <table>
 * <tr><th>Date         <th>Version     <th>Author      <th> Description
 * <tr><td>2023/08/26   <td>1.0         <td>靳普诏       <td> 创建初始版本
 * @copyright   xxxx
 */
'''

import sys
import os
from pathlib import Path

from esm_get_table_info import *
from esm_gen_base_c_source import *


if __name__ == "__main__":
    ## 获取当前脚本所在的目录
    SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
    # 输出目录路径
    print("SCRIPT_DIR: "+ SCRIPT_DIR)

    ## 获取脚本传参
    argv = sys.argv
    argc = len(argv)
    # 打印命令行参数
    #for i in range(1, argc):
        #print("参数", i, ":", argv[i])
        
    print("============= BIGEN: esm_main.py =============")

    if (argc == 1):
        esm = TEsmTableInfo()
        esm.LoadInfoFromXlsx(f"{SCRIPT_DIR}/../ref/EasyStateMachine.xlsx")

        gen_c = TEsmGenCCode(esm, f"{SCRIPT_DIR}/../ref")
        gen_c.GenCode()


    print("============= END: esm_main.py =============")



## Generated on "2023-08-26 17:39:01" by the tool "gen_hq_file.py >> V20230509_1" 